package myapp.com.xm.myapplication;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.view.NestedScrollingParent;
import android.support.v4.view.NestedScrollingParentHelper;
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;

public class RecyclerViewP extends RecyclerView   {
    private Boolean InterceptsonView = true;
    private NestedScrollingParentHelper mParentHelper;

    public RecyclerViewP(@NonNull Context context) {
        super(context);
        init();
    }

    public RecyclerViewP(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    public RecyclerViewP(@NonNull Context context, @Nullable AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        init();
    }

    private void init(){
     //  mParentHelper= new NestedScrollingParentHelper(this);
    }

    public void interceptsonView(boolean sonView) {
        this.InterceptsonView = sonView;
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        Log.e("111","parent:onInterceptTouchEvent");
        return InterceptsonView;
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        Log.e("111","parent:onTouchEvent");
        return super.onTouchEvent(event);
    }
}
